// 菜单权限接口
import request from '@/utils/request'

// 菜单权限列表接口
export function reqGetRuleList(page: number = 1) {
  return request({
    url: '/admin/rule/' + page,
    method: 'get'
  })
}

// 菜单权限添加接口
export function reqAddRule(data: any) {
  return request({
    url: '/admin/rule',
    method: 'post',
    data
  })
}
// 菜单权限修改接口
export function reqUpdateRule(id: number, data: any) {
  return request({
    url: '/admin/rule/' + id,
    method: 'post',
    data
  })
}

// 菜单权限删除接口
export function reqDeleteRule(id: number) {
  return request({
    url: `/admin/rule/${id}/delete`,
    method: 'post'
  })
}

// 修改菜单权限状态
export function reqUpdateRuleStatus(id: number, status: number) {
  return request({
    url: `/admin/rule/${id}/update_status`,
    method: 'post',
    data: {
      status
    }
  })
}
